/*
 * FTNANDC024 driver developed by Mychaela Falconia at CarrierComm, Inc.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */

#ifndef __FTNANDC024_H__
#define __FTNANDC024_H__

/**
 * struct ftnandc024_chip_data - NAND chip info for the FTNANDC024 driver
 *
 * This structure tells the FTNANDC024 driver what it needs to know
 * about a specific NAND flash chip type that can be attached to the
 * controller on a given board.
 */
struct ftnandc024_chip_data {
	/* ID */
	char		*name;
	uint8_t		id_bytes[8];

	/* physical geometry info */
	unsigned	page_size;
	unsigned	block_size_log2;
	unsigned	total_blocks;

	/* data format policy settings */
	unsigned	sector_size;
	unsigned	ecc_level;
	unsigned	oob_size;
	unsigned	oob_ecc_level;
	unsigned	subpage_shift;

	/* definition of partitions */
	struct		mtd_partition *partitions;
	unsigned	partition_count;
};

/**
 * struct ftnandc024_platform_data - FTNANDC024 driver platform data.
 *
 * This structure communicates platform-specific information to the
 * FTNANDC024 driver.
 *
 * NOTE: The present incarnation of the driver and hence of this
 * platform data structure supports only a single NAND chip attached
 * to CE 0 of channel 0.
 */
struct ftnandc024_platform_data {
	/* Timing configuration */
	uint32_t	ac_timing_0;
	uint32_t	ac_timing_1;
	uint32_t	ac_timing_2;

	/* NAND flash chip info */
	struct ftnandc024_chip_data *chip_types;
	unsigned	num_chip_types;
};
#endif
